package com.wisdudu.blank.support.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.orhanobut.logger.Logger;
import com.wisdudu.blank.data.Injection;
import com.wisdudu.blank.data.repo.UserRepo;
import com.wisdudu.blank.support.util.NetUtil;

/**
 * Created by qyf on 2016/8/24.
 */

public class NetworkReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        UserRepo userRepo = Injection.provideUserRepo();

        Logger.d("监听到网络变化：%s，%s", NetUtil.INSTANCE.isConnected(), userRepo.isLogin());
        if (NetUtil.INSTANCE.isConnected()) {
            if (userRepo.isLogin()) {

            }
        }
    }
}
